package apps

import (
	"context"
	"github.com/beherochuling/beesoft_api/app/dao"
	"github.com/beherochuling/beesoft_api/app/model/entity"

	"github.com/beherochuling/beesoft_api/app/helper/net"
	"github.com/beherochuling/beesoft_api/app/model"
	"github.com/beherochuling/beesoft_api/app/model/apps"
)

var Link link

type link struct{}

func (v *link) List(ctx context.Context, req *apps.LinkListRequest) (net.ErrorCode, []entity.NetworkLinks) { // *apps.LinkListResponse) {
	// res := new(apps.LinkListResponse)

	var items []entity.NetworkLinks
	err := dao.NetworkLinks.Ctx(ctx).
		// Where(dao.NetworkLinks.Columns().CategoryId, req.CategoryId).
		Scan(&items)
	if err != nil {
		panic(err)
	}

	return model.SuccessCode, items // res
}
func (v *link) Show(ctx context.Context, req *apps.LinkShowRequest) (net.ErrorCode, *apps.LinkShowResponse) {
	res := new(apps.LinkShowResponse)

	return model.SuccessCode, res
}
func (v *link) Store(ctx context.Context, req *apps.LinkShowRequest) {

}
func (v *link) UpdateById(ctx context.Context, req *apps.LinkUpdateRequest) {

}
func (v *link) DestroyById(ctx context.Context) { // , req *apps.linkDestroyRequest

}
